<template>
  <el-dialog
    :title="$t('set_person')"
    :visible.sync="open"
    width="500px"
    append-to-body
  >
    <el-select v-model="value" filterable :placeholder="$t('please_select',{name:''})">
      <el-option
        v-for="item in options"
        :key="item.id"
        :label="item.employeeName"
        :value="item.id"
      >
      </el-option>
    </el-select>
    <div
      class="departcon"
      style="margin-top: 20px; display: flex; justify-content: flex-end"
    >
      <el-button size="small" @click="handlecancel">{{
        $t("cancel")
      }}</el-button>
      <el-button type="primary" size="small" @click="handleConfirm">{{
        $t("confirm")
      }}</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { pageListByEmployer } from "@/api/custom/employeeList";

export default {
  data() {
    return {
      open: false,
      input: "",
      options: [],
      value: "",
      formData: {},
    };
  },
  created() {},
  methods: {
    handleSetPeo(sign) {
      pageListByEmployer({ department: sign.id, pageSize: 999 }).then((res) => {
        this.options = res.data.records;
        this.open = true;
      });
    },
    handlecancel() {
      this.open = false;
    },
    handleConfirm() {
      this.$confirm(this.$t("successfully_set"), this.$t("prompt"), {
        type: "warning",
      }).then((res) => {
        this.open = false;
        this.$emit("handleSuccess", this.value);
      });
    },
  },
};
</script>

<style lang="scss" scoped></style>
